package com.zzb.controller;

import com.zzb.DTO.ResultDTO;
import com.zzb.VO.NavigationVO;
import com.zzb.service.NavigationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ASUS
 */
@RestController
@CrossOrigin
@RequestMapping("/back/navigation")
public class NavigationController {

    @Autowired
    private NavigationService navigationService;
    @GetMapping("/all")
    public ResultDTO productTypeFindAll(NavigationVO navigationVO) {
        return navigationService.findAll(navigationVO);
    }

    @GetMapping("/id")
    public ResultDTO productTypeFindById(NavigationVO navigationVO) {
        return navigationService.findById(navigationVO);
    }

    @PostMapping("/add")
    public ResultDTO productAdd(NavigationVO navigationVO) {
        return navigationService.add(navigationVO);
    }

    @PostMapping("/update")
    public ResultDTO productUpdate(NavigationVO navigationVO){
        return navigationService.update(navigationVO);
    }

    @PostMapping("/delete")
    public ResultDTO productDelete(NavigationVO navigationVO){
        return navigationService.delete(navigationVO);
    }
}
